/****************************************************************************/
/* File: scs-mouse.h                                                        */
/* Desc: Specification file for the input mouse type                        */
/* Created: 2014-11-11                                                      */
/* Revised: 2014-11-16                                                      */
/* Authors: Sterling P. de Mille                                            */
/****************************************************************************/

// include once
#ifndef _SCS_MOUSE_H_
#define _SCS_MOUSE_H_

// core data types
#include "../Core/scs-types.h"

// SDL framework
#include <SDL/SDL.h>

// assert support
#include <assert.h>

using namespace std;

// mouse state type
struct SCSmousestate {
	SCSint8u iButtonStates;
	SCSint iPosX;
	SCSint iPosY;
	SCSint iScrollValue;
};

// input mouse type
class SCSmouse {
protected:

    SCSbool m_iRelativeMotion;
    SCSmousestate m_kCurrentState;
    SCSmousestate m_kPreviousState;

    static SCSmouse* m_pkSingleton;

    void Init ();
    SCSint SdlButton (SCSint iButton);

public:

    const static SCSint BUTTON_LEFT = 0;
    const static SCSint BUTTON_MIDDLE = 1;
    const static SCSint BUTTON_RIGHT = 2;

    const static SCSint AXISX = 0;
    const static SCSint AXISY = 1;

    const static SCSint WHEEL_UP = 0;
    const static SCSint WHEEL_DOWN = 1;

    SCSmouse ();
    ~SCSmouse ();

    SCSint GetX ();
    SCSint GetY ();

    SCSint DeltaX ();
    SCSint DeltaY ();

    void ScrollUp ();
    void ScrollDown ();
    SCSint ScrollValue ();

    SCSbool ButtonPressed (SCSint iButton);
    SCSbool ButtonReleased (SCSint iButton);
    SCSbool ButtonDown (SCSint iButton);
    SCSbool ButtonUp (SCSint iButton);

    void Update ();

    SCSstring GetLabel (SCSint iEvent);

    static SCSmouse* Singleton ();
};

#endif // _SCS_MOUSE_H_
